home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / bin / partman-command < prev    next >
Text File  |  2009-07-16  |  1KB  |  55 lines

  1. #! /bin/sh
  2. # This script is intended for developer debugging purposes only. If you use
  3. # it for anything else, on your own head be it ...
  4.  
  5. export DEBIAN_FRONTEND=noninteractive
  6.  
  7. . /lib/partman/lib/base.sh
  8.  
  9. if [ "${1#/dev/}" != "$dev" ]; then
  10.     dirname="$(echo "$1" | sed 's:/:=:g')"
  11.     cd "$DEVICES/$dirname" || exit $?
  12.     shift
  13. else
  14.     dir="$(pwd)"
  15.     case $dir in
  16.         $DEVICES/*)
  17.         ;;
  18.         *)
  19.         echo "Must be run from a subdirectory of $DEVICES" >&2
  20.         exit 1
  21.     esac
  22. fi
  23.  
  24. # Within each group, please keep commands in the same order as in
  25. # parted_server.c:main_loop().
  26. case $1 in
  27.     OPEN|OPENED|VIRTUAL|IS_CHANGED|PARTITION_INFO|GET_CHS|USES_NAMES|GET_MAX_PRIMARY|USES_EXTENDED|GET_FILE_SYSTEM|CHECK_FILE_SYSTEM|CREATE_FILE_SYSTEM|NEW_PARTITION|RESIZE_PARTITION|GET_RESIZE_RANGE|VIRTUAL_RESIZE_PARTITION|GET_VIRTUAL_RESIZE_RANGE|GET_LABEL_TYPE|IS_BUSY)
  28.     mode=line
  29.     ;;
  30.     PARTITIONS|LABEL_TYPES|VALID_FLAGS|GET_FLAGS|FILE_SYSTEM_TYPES)
  31.     mode=paragraph
  32.     ;;
  33.     CLOSE|DISK_UNCHANGED|DUMP|COMMIT|UNDO|SET_FLAGS|SET_NAME|CHANGE_FILE_SYSTEM|NEW_LABEL|DELETE_PARTITION|COPY_PARTITION)
  34.     mode=silent
  35.     ;;
  36.     *)
  37.     echo "Unrecognised command: $1" >&2
  38.     exit 1
  39.     ;;
  40. esac
  41.  
  42. open_dialog "$@"
  43. case $mode in
  44.     line)
  45.     read_line response
  46.     echo "$response"
  47.     ;;
  48.     paragraph)
  49.     read_paragraph
  50.     ;;
  51. esac
  52. close_dialog
  53.  
  54. exit 0
  55.